﻿<navigation:Page x:Class="PmuRegistry.Silverlight.Pages.Devices.AddNew" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"           
           Title="PMU Registry: Manage Devices">

    <Grid x:Name="GridAddNew">       
        <Border Style="{StaticResource PortletBorderStyle}">
            <StackPanel Orientation="Vertical">
                <TextBlock Text="Manage Devices" Foreground="#FFFFFFFF" HorizontalAlignment="Center" FontSize="{StaticResource LargerTextSize}" Padding="5" />
                <Border Background="{StaticResource PortletBackgroundBrush}">
                    <Grid x:Name="GridDeviceDetail" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="5">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="2*" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="3*" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="3*" />
                        </Grid.ColumnDefinitions>
                        <!--<TextBlock Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="4" HorizontalAlignment="Right" Text="Click Here to Launch Device Configuration Wizard"/>-->

                        <StackPanel x:Name="StackPanelPhasorsMeassurements" Orientation="Horizontal" Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="2" HorizontalAlignment="Right">
                            <HyperlinkButton Content="Manage Phasors" Tag="{Binding Path=ID}" ToolTipService.ToolTip="{Binding Path=Acronym}" Foreground="#FF095188" FontWeight="Bold" Click="HyperlinkButtonPhasors_Click" />
                            <TextBlock Text="|" HorizontalAlignment="Center" Margin="10,0,10,0" />
                            <HyperlinkButton Content="Manage Meassurements" Tag="{Binding Path=ID}" ToolTipService.ToolTip="{Binding Path=Acronym}" Foreground="#FF095188" FontWeight="Bold" Click="HyperlinkButtonMeasurements_Click"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="0">
                            <TextBlock Text="Acronym" Style="{StaticResource GenericLabelStyle}"/>
                            <TextBlock Text="*" Foreground="#FFCC0000" Style="{StaticResource GenericLabelStyle}" />
                        </StackPanel>
                        <TextBox x:Name="TextBoxAcronym" Grid.Row="1" Grid.Column="1" Text="{Binding Path=Acronym}" Width="{StaticResource SmallerItemSize}" Height="{StaticResource XXXSmallItemSize}" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center" Margin="5" />
                        <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="2">
                            <TextBlock Text="Name" Style="{StaticResource GenericLabelStyle}"/>
                            <TextBlock Text="*" Foreground="#FFCC0000" Style="{StaticResource GenericLabelStyle}" />
                        </StackPanel>
                        <TextBox x:Name="TextBoxName" Grid.Row="1" Grid.Column="3" Text="{Binding Path=Name}" Width="{StaticResource XLargeItemSize}" Height="{StaticResource XXXSmallItemSize}" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center" Margin="5" />
                        <StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="0">
                            <TextBlock Text="Substation Acronym" Style="{StaticResource GenericLabelStyle}"/>
                            <TextBlock Text="*" Foreground="#FFCC0000" Style="{StaticResource GenericLabelStyle}" />
                        </StackPanel>
                        <TextBox x:Name="TextBoxSubstationAcronym" Grid.Row="2" Grid.Column="1" Text="{Binding Path=SubstationAcronym}" Width="{StaticResource SmallerItemSize}" Height="{StaticResource XXXSmallItemSize}" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center" Margin="5" />
                        <TextBlock Grid.Row="2" Grid.Column="2" Text="Substation Name" Style="{StaticResource GenericLabelStyle}"/>
                        <TextBox x:Name="TextBoxSubstationName" Grid.Row="2" Grid.Column="3" Text="{Binding Path=SubstationName}" Width="{StaticResource XLargeItemSize}" Height="{StaticResource XXXSmallItemSize}" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center" Margin="5" />
                        <TextBlock Grid.Row="3" Grid.Column="0" Text="Company" Style="{StaticResource GenericLabelStyle}"/>
                        <ComboBox x:Name="ComboboxCompany" Grid.Row="3" Grid.Column="1" Margin="5" DisplayMemberPath="Value" Width="{StaticResource XLargeItemSize}" HorizontalAlignment="Left"/>
                        <TextBlock Grid.Row="3" Grid.Column="2" Text="Concentrator" Style="{StaticResource GenericLabelStyle}"/>
                        <StackPanel Orientation="Horizontal" Grid.Row="3" Grid.Column="3">
                            <ComboBox x:Name="ComboboxParent" Margin="5" DisplayMemberPath="Value" Width="{StaticResource LargerItemSize}" HorizontalAlignment="Center"/>
                            <Button x:Name="ButtonView" Content="../../Images/Search.png" Tag="" Template="{StaticResource ImageButtonTemplate}" VerticalAlignment="Center" Margin="5" ToolTipService.ToolTip="View Concentrator Information"/>
                        </StackPanel>
                        <TextBlock Grid.Row="4" Grid.Column="0" Text="Interconnection" Style="{StaticResource GenericLabelStyle}"/>
                        <ComboBox x:Name="ComboboxInterconnection" Grid.Row="4" Grid.Column="1" Margin="5" DisplayMemberPath="Value" Width="{StaticResource XLargeItemSize}" HorizontalAlignment="Left"/>
                        <TextBlock Grid.Row="4" Grid.Column="2" Text="Device Vendor" Style="{StaticResource GenericLabelStyle}"/>
                        <ComboBox x:Name="ComboboxVendorDevice" Grid.Row="4" Grid.Column="3" Margin="5" DisplayMemberPath="Value" Width="{StaticResource XLargeItemSize}" HorizontalAlignment="Left"/>
                        <TextBlock Grid.Row="5" Grid.Column="0" Text="Protocol" Style="{StaticResource GenericLabelStyle}"/>
                        <ComboBox x:Name="ComboboxProtocol" Grid.Row="5" Grid.Column="1" Margin="5" DisplayMemberPath="Value" Width="{StaticResource XLargeItemSize}" HorizontalAlignment="Left"/>
                        <TextBlock Grid.Row="5" Grid.Column="2" Text="Time Zone" Style="{StaticResource GenericLabelStyle}"/>
                        <ComboBox x:Name="ComboboxTimeZone" Grid.Row="5" Grid.Column="3" DisplayMemberPath="Value" Margin="5" Width="{StaticResource XLargeItemSize}" HorizontalAlignment="Left"/>
                        <TextBlock Grid.Row="6" Grid.Column="0" Text="Longitude" Style="{StaticResource GenericLabelStyle}"/>
                        <TextBox x:Name="TextBoxLongitude" Grid.Row="6" Grid.Column="1" Text="{Binding Path=Longitude}" Width="{StaticResource SmallItemSize}" Height="{StaticResource XXXSmallItemSize}" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center" Margin="5" />
                        <TextBlock Grid.Row="6" Grid.Column="2" Text="Latitude" Style="{StaticResource GenericLabelStyle}"/>
                        <TextBox x:Name="TextBoxLatitude" Grid.Row="6" Grid.Column="3" Text="{Binding Path=Latitude}" Width="{StaticResource SmallItemSize}" Height="{StaticResource XXXSmallItemSize}" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center" Margin="5" />
                        <StackPanel Orientation="Horizontal" Grid.Row="7" Grid.Column="0">
                            <TextBlock Text="Measured Lines" Style="{StaticResource GenericLabelStyle}"/>
                            <TextBlock Text="*" Foreground="#FFCC0000" Style="{StaticResource GenericLabelStyle}" />                        
                        </StackPanel>
                        <TextBox x:Name="TextBoxMeasuredLines" Grid.Row="7" Grid.Column="1" Text="{Binding Path=MeasuredLines}" Width="{StaticResource SmallerItemSize}" Height="{StaticResource XXXSmallItemSize}" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center" Margin="5" />
                        <TextBlock Grid.Row="7" Grid.Column="2" Text="Status" Style="{StaticResource GenericLabelStyle}"/>
                        <ComboBox x:Name="ComboboxStatus" Grid.Row="7" Grid.Column="3" Margin="5" DisplayMemberPath="Value"  Width="{StaticResource XLargeItemSize}" HorizontalAlignment="Left"/>
                        <TextBlock Grid.Row="8" Grid.Column="0" Text="Technical Contact" Style="{StaticResource GenericLabelStyle}"/>
                        <ComboBox x:Name="ComboboxTechnicalContact" Grid.Row="8" Grid.Column="1" Margin="5" DisplayMemberPath="Value" Width="{StaticResource XLargeItemSize}" HorizontalAlignment="Left"/>
                        <TextBlock Grid.Row="8" Grid.Column="2" Text="Funding Source" Style="{StaticResource GenericLabelStyle}"/>
                        <ComboBox x:Name="ComboboxFundingSource" Grid.Row="8" Grid.Column="3" Margin="5" DisplayMemberPath="Value" Width="{StaticResource LargerItemSize}" HorizontalAlignment="Left"/>
                        
                        <CheckBox x:Name="CheckboxConcentrator" Grid.Row="9" Grid.Column="3" IsChecked="{Binding Path=IsConcentrator}" Content="Concentrator" VerticalAlignment="Center" FontWeight="Bold" Margin="5"/>                        
                        <StackPanel Orientation="Horizontal" Grid.Row="10" Grid.Column="3" HorizontalAlignment="Right" VerticalAlignment="Center">
                            <Button x:Name="ButtonClear" Content="../../Images/Cancel.png" Tag="Clear" Template="{StaticResource ImageButtonTemplate}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5" Cursor="Hand">
                                <Button.RenderTransform>
                                    <ScaleTransform x:Name="ButtonClearTransform" ScaleX="1" ScaleY="1" />
                                </Button.RenderTransform>
                            </Button>
                            <TextBlock Text="     "/>
                            <Button x:Name="ButtonSave" Content="../../Images/Save.png" Tag="Save" Template="{StaticResource ImageButtonTemplate}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5">
                                <Button.RenderTransform>
                                    <ScaleTransform x:Name="ButtonSaveTransform" ScaleX="1" ScaleY="1" />
                                </Button.RenderTransform>
                            </Button>
                        </StackPanel>
                        <TextBlock x:Name="TextBlockMessage" Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="10"/>
                    </Grid>
                </Border>
                <StackPanel Orientation="Vertical" x:Name="StackPanelDeviceList">
                    <TextBlock x:Name="TextBlockTitle" Text="Devices For Concentrator" Foreground="#FFFFFFFF" FontWeight="Bold" HorizontalAlignment="Center" FontSize="{StaticResource LargerTextSize}" Padding="5" />
                    <Border Style="{StaticResource HeaderRowBorderStyle}">
                        <StackPanel Orientation="Horizontal" Margin="2">
                            <Border Style="{StaticResource HeaderRowCellBorderStyle}">
                                <TextBlock Text="Acronym" Width="{StaticResource XSmallItemSize}" TextAlignment="Center" FontSize="{StaticResource LargeTextSize}" FontWeight="Bold"/>
                            </Border>
                            <Border Style="{StaticResource HeaderRowCellBorderStyle}">
                                <TextBlock Text="Name" Width="{StaticResource SmallItemSize}" TextAlignment="Center" FontSize="{StaticResource LargeTextSize}" FontWeight="Bold"/>
                            </Border>
                            <Border Style="{StaticResource HeaderRowCellBorderStyle}">
                                <TextBlock Text="Protocol" Width="{StaticResource LargerItemSize}" TextAlignment="Center" FontSize="{StaticResource LargeTextSize}" FontWeight="Bold"/>
                            </Border>
                            <Border Style="{StaticResource HeaderRowCellBorderStyle}">
                                <TextBlock Text="Company Name" Width="{StaticResource LargerItemSize}" TextAlignment="Center" FontSize="{StaticResource LargeTextSize}" FontWeight="Bold"/>
                            </Border>
                            <Border Style="{StaticResource HeaderRowCellBorderStyle}">
                                <TextBlock Text="Vendor Device" Width="{StaticResource LargeItemSize}" TextAlignment="Center" FontSize="{StaticResource LargeTextSize}" FontWeight="Bold"/>
                            </Border>
                            <TextBlock Text="Enabled" Width="{StaticResource XSmallItemSize}" TextAlignment="Center" FontSize="{StaticResource LargeTextSize}" FontWeight="Bold"/>
                        </StackPanel>
                    </Border>
                    <Border Background="{StaticResource PortletBackgroundBrush}">
                        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" BorderThickness="0" Height="260">
                            <ScrollViewer.Content>
                                <ListBox x:Name="ListBoxDeviceList" Margin="0" Padding="0">
                                    <ListBox.ItemTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <Border Style="{StaticResource ContentRowCellBorderStyle}">
                                                    <HyperlinkButton Content="{Binding Path=Acronym}" Tag="{Binding Path=ID}" Foreground="#FF095188" Width="{StaticResource XSmallItemSize}" Click="HyperlinkButton_Click"/>
                                                </Border>
                                                <Border Style="{StaticResource ContentRowCellBorderStyle}">
                                                    <TextBlock Text="{Binding Path=Name}" Width="{StaticResource SmallItemSize}" TextAlignment="Left" Padding="1"/>
                                                </Border>
                                                <Border Style="{StaticResource ContentRowCellBorderStyle}">
                                                    <TextBlock Text="{Binding Path=ProtocolName}" Width="{StaticResource LargerItemSize}" TextAlignment="Left" Padding="1"/>
                                                </Border>
                                                <Border Style="{StaticResource ContentRowCellBorderStyle}">
                                                    <TextBlock Text="{Binding Path=CompanyName}" Width="{StaticResource LargerItemSize}" TextAlignment="Left" Padding="1"/>
                                                </Border>
                                                <Border Style="{StaticResource ContentRowCellBorderStyle}">
                                                    <TextBlock Text="{Binding Path=VendorDeviceName}" Width="{StaticResource LargeItemSize}" TextAlignment="Left" Padding="1"/>
                                                </Border>
                                                <Border Style="{StaticResource ContentRowCellBorderStyle}" Width="{StaticResource XSmallItemSize}">
                                                    <CheckBox HorizontalAlignment="Center" IsChecked="{Binding Path=Enabled}" IsEnabled="False" />
                                                </Border>
                                            </StackPanel>
                                        </DataTemplate>
                                    </ListBox.ItemTemplate>
                                </ListBox>
                            </ScrollViewer.Content>
                        </ScrollViewer>
                    </Border>
                </StackPanel>
            </StackPanel>
        </Border>
    </Grid>

</navigation:Page>
